package animal;

public class Cat extends Animal{
    //属性:体重
    private double weight;
    //无参构造
    public Cat(){

    }
    //带参构造
    public Cat(String name,int month,double weight){
        super(name,month);//相当于this.setName(name);this.setAge(month);
        this.setWeight(weight);
    }
    //get/set方法

    public double getWeight() {
        return weight;
    }

    public void setWeight(double weight) {

        this.weight = weight;
    }

    //方法:跑动
    public String run(){
        String str="小猫快乐的奔跑!";
        return str;
    }

    //方法:吃东西(重写父类方法)
    //父类中的eat()方法是抽象方法,子类必须重写该方法
    @Override
    public String eat() {
        String str="猫吃鱼~~";
        return  str;
    }
}
